home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Graphics Programming (2nd Edition)
/
Visual Basic Graphics Programming 2nd Edition.iso
/
OldSrc
/
CH3
/
SRC
/
OBJPRINT.FRM
< prev
next >
Wrap
Text File
|
1996-01-31
|
2KB
|
77 lines
VERSION 4.00
Begin VB.Form ObjPrintForm
BorderStyle = 1 'Fixed Single
Caption = "ObjPrint"
ClientHeight = 3090
ClientLeft = 2640
ClientTop = 1635
ClientWidth = 3090
Height = 3780
Left = 2580
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3090
ScaleWidth = 3090
Top = 1005
Width = 3210
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFilePrint
Caption = "&Print"
End
Begin VB.Menu mnuFileSep
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
End
Attribute VB_Name = "ObjPrintForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
' ************************************************
' Draw a diamond on the form or printer.
' ************************************************
Sub DrawPicture(obj As Object)
obj.CurrentX = 1540
obj.CurrentY = 100
obj.Line -Step(1440, 1440)
obj.Line -Step(-1440, 1440)
obj.Line -Step(-1440, -1440)
obj.Line -Step(1440, -1440)
End Sub
' ************************************************
' Draw the picture on the form.
' ************************************************
Private Sub Form_Paint()
Cls
DrawPicture Me
End Sub
Private Sub mnuFileExit_Click()
Unload Me
End Sub
' ***********************************************
' Draw the picture on the Printer object.
' ***********************************************
Private Sub mnuFilePrint_Click()
MousePointer = vbHourglass
DoEvents
DrawPicture Printer
Printer.EndDoc
MousePointer = vbDefault
End Sub